package com.base.util.demo;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.base.util.demo.jniutils.JniUtilsActivity;
import com.base.util.demo.test.TestActivity;
import com.base.util.javautils.app.BaseActivity;
import com.base.util.javautils.log.ILogPrinter;
import com.base.util.javautils.log.LogUtil;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

@ContentView(R.layout.activity_main)
public class MainActivity extends DemoBaseActivity {

    @ViewInject(R.id.btn_test_jniutils)
    private Button m_btnTestJniUtils;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // 测试中LogUtil
        LogUtil.v("test --> %s", "onCreate");
        LogUtil.i("test --> %s", "onCreate");
        LogUtil.d("test --> %s", "onCreate");
        LogUtil.w("test --> %s", "onCreate");
        LogUtil.e("test --> %s", "onCreate");
        LogUtil.wtf("test --> %s", "onCreate");
        LogUtil.json("{\"aaa\":2}");
        try {
            String a = null;
            a.length();
        } catch (Exception e) {
            LogUtil.e(e, "test --> %s", "onCreate");
        }
        ILogPrinter printer = LogUtil.createLogPrinter(MainActivity.class);
        printer.v("test --> %s", "onCreate");
        printer.i("test --> %s", "onCreate");
        printer.d("test --> %s", "onCreate");
        printer.w("test --> %s", "onCreate");
        printer.e("test --> %s", "onCreate");
        printer.wtf("test --> %s", "onCreate");
        printer.json("{\"aaa\":2}");
        try {
            String a = null;
            a.length();
        } catch (Exception e) {
            printer.e(e, "test --> %s", "onCreate");
        }
    }

    @Event(value = R.id.btn_test_jniutils)
    private void toTestJniUtilsActivity(View v) {
        JniUtilsActivity.show(this);
    }

    @Event(value = R.id.btn_test)
    private void toTestActivity(View v) {
        TestActivity.show(this);
    }

}
